package com.developer.platform.domain;

import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.developer.platform.infrastructure.enums.StatusEnum;
import com.veeker.core.basics.AggregateRoot;
import com.veeker.core.utils.JsonUtils;
import java.util.Date;
import java.util.List;

/**
 * @author ：qiaoliang
 * @date ：2021-01-07
 */
public class NoticeAggregateRoot implements AggregateRoot {
  private Long id;
  /** 群ID **/
  private Long groupId;
  /** 模板ID **/
  private Long templateId;
  /** 更新内容 **/
  private String contents;
  /** 更新说明连接 **/
  private String urls;
  /** 更新时长（分钟） **/
  private int duration;
  /** 更新方式（停服Y，不停服N） **/
  private StatusEnum mode;
  /** 数据库是否已变动 **/
  private StatusEnum dataChanged;
  /** 上线时间 **/
  private Date onlineTime;
  /** 反馈时间 **/
  private int feedback;
  /** 风险等级 **/
  private int risk;
  /** 状态 **/
  private StatusEnum status;
  /** 推送时间 **/
  private Date pushTime;

  private Long createBy;
  private Date createTime;
  private Long updateBy;
  private Date updateTime;
  private String remark;

  /** 更新系统 **/
  private List<Long> systemIds;
  /** 受影响系统 **/
  private List<Long> influenceIds;

  /** 更新人员 **/
  private List<Long> durationUserIds;
  /** 通知人员 **/
  private List<Long> noticeUserIds;
  /** 电话通知人员 **/
  private List<Long> tellUserIds;
  /** 数据库变动通知人员 **/
  private List<Long> dateUserIds;

  public NoticeAggregateRoot() {
  }

  public NoticeAggregateRoot(Long id) {
    this.id = id;
  }

  public String getDurationName() {
    return duration+"分钟";
  }
  public String getModeName() {
    if(StatusEnum.Y.equals(mode)){
      return "停服更新";
    }
    return "不停服更新";
  }
  public String getDataChangedName() {
    if(StatusEnum.Y.equals(dataChanged)){
      return "已变动";
    }
    return "未变动";
  }
  public String getFeedbackName() {
    return feedback+"分钟";
  }
  public String getRiskName() {
    if(0 == risk){
      return "低风险";
    }
    if(1 == risk){
      return "中风险";
    }
    return "高风险";
  }
  public String getOnlineTimeName() {
    return DateUtil.formatDateTime(onlineTime);
  }


  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getGroupId() {
    return groupId;
  }

  public void setGroupId(Long groupId) {
    this.groupId = groupId;
  }

  public Long getTemplateId() {
    return templateId;
  }

  public void setTemplateId(Long templateId) {
    this.templateId = templateId;
  }

  public String getContents() {
    return contents;
  }

  public void setContents(String contents) {
    this.contents = contents;
  }

  public String getUrls() {
    return urls;
  }

  public void setUrls(String urls) {
    this.urls = urls;
  }

  public int getDuration() {
    return duration;
  }

  public void setDuration(int duration) {
    this.duration = duration;
  }

  public StatusEnum getMode() {
    return mode;
  }


  public void setMode(StatusEnum mode) {
    this.mode = mode;
  }

  public StatusEnum getDataChanged() {
    return dataChanged;
  }

  public void setDataChanged(StatusEnum dataChanged) {
    this.dataChanged = dataChanged;
  }

  public Date getOnlineTime() {
    return onlineTime;
  }

  public void setOnlineTime(Date onlineTime) {
    this.onlineTime = onlineTime;
  }

  public int getFeedback() {
    return feedback;
  }

  public void setFeedback(int feedback) {
    this.feedback = feedback;
  }

  public int getRisk() {
    return risk;
  }

  public void setRisk(int risk) {
    this.risk = risk;
  }

  public StatusEnum getStatus() {
    return status;
  }

  public void setStatus(StatusEnum status) {
    this.status = status;
  }

  public Date getPushTime() {
    return pushTime;
  }

  public void setPushTime(Date pushTime) {
    this.pushTime = pushTime;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public List<Long> getSystemIds() {
    return systemIds;
  }

  public void setSystemIds(List<Long> systemIds) {
    this.systemIds = systemIds;
  }

  public List<Long> getInfluenceIds() {
    return influenceIds;
  }

  public void setInfluenceIds(List<Long> influenceIds) {
    this.influenceIds = influenceIds;
  }

  public List<Long> getDurationUserIds() {
    return durationUserIds;
  }

  public void setDurationUserIds(List<Long> durationUserIds) {
    this.durationUserIds = durationUserIds;
  }

  public List<Long> getNoticeUserIds() {
    return noticeUserIds;
  }

  public void setNoticeUserIds(List<Long> noticeUserIds) {
    this.noticeUserIds = noticeUserIds;
  }

  public List<Long> getTellUserIds() {
    return tellUserIds;
  }

  public void setTellUserIds(List<Long> tellUserIds) {
    this.tellUserIds = tellUserIds;
  }

  public List<Long> getDateUserIds() {
    return dateUserIds;
  }

  public void setDateUserIds(List<Long> dateUserIds) {
    this.dateUserIds = dateUserIds;
  }

  public Long getCreateBy() {
    return createBy;
  }

  public void setCreateBy(Long createBy) {
    this.createBy = createBy;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Long getUpdateBy() {
    return updateBy;
  }

  public void setUpdateBy(Long updateBy) {
    this.updateBy = updateBy;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }
}
